/**
 * Copyright © 2014 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */
package org.rayson.server.common.parser;

import org.rayson.api.KeyValues;
import org.rayson.api.annotation.NotNull;
import org.rayson.api.exception.ProtocolException;

/**
 * An object used to parse Rayson request parameters.
 * 
 * @author creativor
 */
public interface ParameterParser {

	/**
	 * Parse parameters to <code>target</code> from <code>data</code>.
	 * 
	 * @param data
	 *            Source parameter data.
	 * @param target
	 *            Parameter result target.
	 * @throws ProtocolException
	 *             If the data is wrong format according to the protocol.
	 */
	public void parse(@NotNull byte[] data, @NotNull KeyValues target)
			throws ProtocolException;
}
